{include file="header.html"}
<body class="body-main">

<ul id="admin_sub_title">
	<li class="unsub"><a href="{url('admin/cache/index')}">缓存设置</a></li>
	<li class="sub"><a href="javascript:void(0)">清除缓存</a></li>
	<li class="unsub"><a href="{url('admin/cache/clearzd')}" style="color:red">清除指定缓存</a></li>
</ul>

<div id="admin_right_b">

  <table border="0" style="width:100%" align="center" cellpadding="3" cellspacing="0" class="table_b">

	<tr align='center'>
	  <td class="title_bg" width="600">缓存说明</td>
      <td class="title_bg" width="120">缓存大小</td>
      <td width="100" class="title_bg">操作</td>
	  <td class="title_bg">&nbsp;</td>
    </tr>
	<tr class="tdbg item_title">
		<td colspan="4"><i class="typcn typcn-cog"></i> 核心缓存</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">模板编译缓存 (<span>修改模板后，需要清除模板缓存才能生效</span>)</td>
		<td align='center'><font color='green'>{$compile_cache} MB</font></td>
		<td align='center' id="compile"><button type="button" class="button" onClick="delcache('compile');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">域名模板缓存 (<span>清除后未绑定模板的域名对应的模板可能会改变</span>)</td>
		<td align='center'><a id="c_theme" onclick="checkcache('theme');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="theme"><button type="button" class="button" onClick="delcache('theme');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">文件索引缓存 (<span style="color:red">清除可能导致tkd变化</span>)</td>
		<td align='center'><a id="c_filelist" onclick="checkcache('filelist');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="filelist"><button type="button" class="button" onClick="delcache('filelist');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">外链缓存 (<span>外链调用的缓存，清除可更新外链，路径：./temp/cache/tags/loop_link</span>)</td>
		<td align='center'><a id="c_link" onclick="checkcache('link');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="link"><button type="button" class="button" onClick="delcache('link');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">导航缓存 (<span>一般不用清除</span>)</td>
		<td align='center'><a id="c_menu" onclick="checkcache('menu');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="menu"><button type="button" class="button" onClick="delcache('menu');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">tkd等缓存 (<span>标题、keywords、description等缓存，路径：./temp/cache/tags/tkd</span>)</td>
		<td align='center'><a id="c_tkd" onclick="checkcache('tkd');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="tkd"><button type="button" class="button" onClick="delcache('tkd');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">url规则缓存 (<span>一般不用清除</span>)</td>
		<td align='center'><a id="c_urlrules" onclick="checkcache('urlrules');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="urlrules"><button type="button" class="button" onClick="delcache('urlrules');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">采集历史缓存 (<span>采集过的url、标题记录，有效避免重复采集、重复入库</span>)</td>
		<td align='center'><a id="c_courl" onclick="checkcache('courl');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="courl"><button type="button" class="button" onClick="delcache('courl');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">蜘蛛访问记录</td>
		<td align='center'><a id="c_robotlog" onclick="checkcache('robotlog');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="robotlog"><button type="button" class="button" onClick="delcache('robotlog');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">自动采集缓存 (<span>自动采集出现问题可清除此缓存</span>)</td>
		<td align='center'><a id="c_collect_auto" onclick="checkcache('collect_auto');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="collect_auto"><button type="button" class="button" onClick="delcache('collect_auto');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">其他系统缓存</td>
		<td align='center'><a id="c_tempcache" onclick="checkcache('tempcache');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="tempcache"><button type="button" class="button" onClick="delcache('tempcache');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg item_title">
		<td colspan="4"><i class="typcn typcn-cog"></i> 内置模板静态页面缓存（<font color="red">hash方式</font>）</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">首页静态缓存 (<span>路径：./temp/cache/html/index</span>)</td>
		<td align='center'><a id="c_tpl_index" onclick="checkcache('tpl_index');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="tpl_index"><button type="button" class="button" onClick="delcache('tpl_index');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">列表页静态缓存 (<span>路径：./temp/cache/html/list</span>)</td>
		<td align='center'><a id="c_tpl_list" onclick="checkcache('tpl_list');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="tpl_list"><button type="button" class="button" onClick="delcache('tpl_list');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">内容页静态缓存 (<span>路径：./temp/cache/html/show</span>)</td>
		<td align='center'><a id="c_tpl_show" onclick="checkcache('tpl_show');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="tpl_show"><button type="button" class="button" onClick="delcache('tpl_show');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">其他页静态缓存 (<span>路径：./temp/cache/html/other</span>)</td>
		<td align='center'><a id="c_other" onclick="checkcache('other');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="other"><button type="button" class="button" onClick="delcache('other');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<!-- <tr class="tdbg item_title">
		<td colspan="4"><i class="typcn typcn-cog"></i> 自定义模板静态缓存</td>
	</tr>
	{foreach $list as $k=>$vo}
	<tr class="tdbg">
		<td style="padding-left:20px">{$k}页静态缓存</td>
		<td align='center'><a id="c_tpl_{$k}" onclick="checkcache('tpl_{$k}');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="tpl_{$k}"><button type="button" class="button" onClick="delcache('tpl_{$k}');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	{/foreach} -->

	<tr class="tdbg item_title">
		<td colspan="4"><i class="typcn typcn-cog"></i> 全部缓存</td>
	</tr>
	
	<tr class="tdbg">
		<td style="padding-left:20px">redis缓存 (<span>{if $redis_open}已开启{else}<font color="red">未开启redis缓存</font>{/if}</span>)</td>
		<td align='center'><a id="c_redis" onclick="checkcache('redis');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="redis"><button type="button" class="button" onClick="delcache('redis');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">所有静态页面缓存（<font color="red">hash方式</font>） (<span>所有页面静态缓存，路径：./temp/cache/html</span>)</td>
		<td align='center'><a id="c_html" onclick="checkcache('html');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="html"><button type="button" class="button" onClick="delcache('html');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">所有静态页面缓存（<font color="red">URL方式</font>） (<span>所有页面静态缓存，路径：./temp/cache/htmlfile</span>)</td>
		<td align='center'><a id="c_htmlfile" onclick="checkcache('htmlfile');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="htmlfile"><button type="button" class="button" onClick="delcache('htmlfile');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
	<tr class="tdbg">
		<td style="padding-left:20px">所有文件缓存</td>
		<td align='center'><a id="c_all" onclick="checkcache('all');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="all"><button type="button" class="button button_remove" onClick="delcache('all');">清除缓存</button></td>
		<td>&nbsp;</td>
	</tr>
  </table>
<script type="text/javascript">
function delcache(dir){
	if(dir=='robotlog' || dir=='filelist' || dir=='theme'){
		if(!confirm("确定清除？清除后不可恢复!")){
			return false;
		}
	}
	$('#'+dir).html("<img src='static/images/load_blue.gif'>");
	$.ajax({
	   type: "POST",
	   url: "{url('admin/cache/clear_del')}",
	   dataType: "json",
	   data: "action=del&file="+dir,
	   success: function(a){
		   if(a.status==1){
				$('#'+dir).html("<font color='green'>清除成功</font>");
		   }else{
				$('#'+dir).html("<font color='red'>"+a.info+"</font>");
		   }
	   }
	});
}
function checkcache(dir){
	$('#c_'+dir).html("<img src='static/images/load_blue.gif'>");
	$.ajax({
	   type: "POST",
	   url: "{url('admin/cache/clear_del')}",
	   dataType: "json",
	   data: "action=checksize&file="+dir,
	   success: function(a){
		   if(a.status==1){
				$('#c_'+dir).html("<font color='green'>"+a.size+"</font>");
		   }else{
				$('#c_'+dir).html("<font color='red'>"+a.info+"</font>");
		   }
	   }
	});
}
</script>
<div class="runtime"></div>  
</div>
{include file="footer.html"}
</body>
</html>